using System;
using ASPNETVN.PORTAL.Components.Helpers;
using ASPNETVN.PORTAL.Components.UI;
using ASPNETVN.PORTAL.Components.Security;

namespace ASPNETVN.PORTAL.Modules.SUPPORT.Controls
{
    public partial class Topic : ModulePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack == false)
            {
                sdsTopic.SelectParameters["ModuleID"].DefaultValue = this.ModuleID.ToString();
                if (PortalSecurity.CurrentUser.Identity.IsAuthenticated)
                {
                    sdsTopic.SelectParameters["CreatedBy"].DefaultValue = PortalSecurity.CurrentUser.Identity.Email;
                }
            }
        }

        protected void gvTopic_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e)
        {
           
        }

        protected void gvTopic_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (gvTopic.SelectedDataKey != null)
            {
                string url = HttpUrlBuilder.BuildModulePageUrl(this.ModuleID, Convert.ToInt32(gvTopic.SelectedDataKey.Value.ToString()), ModulePages.Message);
                Response.Redirect(url);
            }
        }
    }
}